#include <iostream>

using namespace std;

class Point;
double getDistance(Point x, Point y);

class Print
{
public:
    void print(Point A);
};

class ToZero
{
public:
    double toZero(Point A);
};

class Point
{
public:
    Point(int x, int y);

    friend double getDistance(Point x, Point y); //set normal function friend
    friend void Print::print(Point A);  //set other class function member friend
    friend ToZero;  //set other class friend

private:
    int _ix;
    int _iy;
};

Point::Point(int x, int y): _ix(x), _iy(y){}

void Print::print(Point A)
{
    //can use private varibale
    cout << "(" << A._ix << "," << A._iy << ")" << endl;
}

double ToZero::toZero(Point A)
{
    //can use private varibale
    cout << "(" << A._ix << "," << A._iy << ")" << endl;
    cout << "Here is location, calculate by yourself" << endl;

    return 0;
}

double getDistance(Point x, Point y)
{
    //can use private varibale
    cout << "(" << x._ix << "," << x._iy << ")" << endl;
    cout << "(" << y._ix << "," << y._iy << ")" << endl;
    cout << "Here is location, calculate by yourself" << endl;

    return 0;
}

void test1()
{
    Print p;
    ToZero t;
    Point pt1(3,4);
    Point pt2(5,12);

    getDistance(pt1, pt2);
    p.print(pt1);
    t.toZero(pt2);
}

int main()
{
    test1();
    return 0;
}

